package com.ssy.lingxi.search.service;

import com.ssy.lingxi.common.constant.tree.Node;
import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.search.api.model.request.CommoditySearchRequest;
import com.ssy.lingxi.search.api.model.request.StoreIdListRequest;
import com.ssy.lingxi.search.api.model.response.BrandResponse;
import com.ssy.lingxi.search.api.model.response.CategoryResponse;
import com.ssy.lingxi.search.api.model.response.CommoditySearchResponse;

import java.util.List;
import java.util.Map;

/**
 * 商品搜索管理类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/7/28
 */
public interface ITemplateService {

    /**
     * 查询商品品类树
     * @param memberId 会员id
     * @return
     */
    List<Node> getCategoryTree(Long shopId, Long memberId, Long memberRoleId);

    /**
     * 查询品牌
     * @param pageVO
     * @param searchRequest
     * @return
     */
    PageData<BrandResponse> searchBrandList(PageVO pageVO, CommoditySearchRequest searchRequest);

    /**
     * 查询一级分类
     * @param memberId
     * @return
     */
    List<CategoryResponse> getFirstCategoryList(Long shopId, Long memberId, Long memberRoleId);

    /**
     * 查询二级分类
     * @param memberId
     * @param categoryId
     * @return
     */
    List<CategoryResponse> getSecondCategoryList(Long shopId, Long memberId, Long memberRoleId, Long categoryId);

    /**
     * 通过品类查询会员信息
     * @param categoryId
     * @return
     */
    List<Long> getMemberIdByCategory(Long shopId, Long categoryId);

    /**
     * 根据店铺id集合查找最新上架的商品
     * @param storeIdListRequest 参数
     */
    Map<Long, List<CommoditySearchResponse>> getCommodityListByPublishTime(StoreIdListRequest storeIdListRequest);

    /**
     * 根据店铺id集合查找消息最高的商品
     * @param storeIdListRequest 参数
     */
    Map<Long, List<CommoditySearchResponse>> getCommodityListBySoldCount(StoreIdListRequest storeIdListRequest);
}
